set PATH=D:\Dev-Tool\OpenSSL-Win64\bin;%PATH%
set OPENSSL_CONF=D:/Dev-Tool/OpenSSL-Win64/BIN/openssl.cfg
openssl genrsa -des3 -out private.pem 1024
openssl rsa -in private.pem -outform PEM -pubout -out public.pem

openssl req -new -key private.pem -out cert.csr
openssl req -x509 -key private.pem -in cert.csr -out cacert.pem -days 365

pkcs12 -export -in server.crt -inkey private.pem -out server.p12 -name "tomcat"

openssl verify -CAfile cacert.crt -verbose server.crt

openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -name "tomcat" -CAfile authorities.crt -caname root-ca.crt -chain

rem openssl pkcs12 -export -in cacert.pem -inkey private.key -out cert.p12 -name tomcat -chain -CAFile server.srt

rem openssl x509 -in cert.csr -out server.crt -req -signkey server.key -days 365
